home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 050a.dms / 050a.adf / TEXTS / chapter13.txt < prev    next >
Text File  |  1992-02-26  |  6KB  |  138 lines

  1.                      The Absolute Beginners Guide To Amos
  2.                     -------------------------------------
  3.                                Chapter thirteen
  4.                                ----------------
  5. In this chapter, as promised earlier, we take a look at customizing our own 
  6. screens.  But first, the answers to self test quiz number 3:
  7.  
  8.                        1. A       6. C
  9.                        2. B       7. C
  10.                        3. C       8. C
  11.                        4. A       9. A
  12.                        5. C      10. C
  13. ---------------------------------------------------------------------------
  14. EXAMPLE13.Amos is a small demonstration of opening screens of different
  15. sizes, colours and resolutions, why would we want to do that? Well let us
  16. say you were writing a word processor program.  If you were to use Amos`s
  17. default screen of 40 characters across it would look pretty shoddy against
  18. a nice 80 column text display which is very easy to set up.  There are many
  19. more uses which I do not want to go into yet to save you confusion.  Let us 
  20. get on with the SCREEN OPEN command.
  21.  
  22. SCREEN OPEN 0,320,200,16,lowres
  23.  
  24. The above line simulates the Amos default screen we have been using in all
  25. of our example programs so far.
  26. The 0 is just an I.D number so you can keep track of your screens if you 
  27. have more than one screen open at a time.  You can have up to eight screens
  28. open at once, numbered 0-7.
  29.  
  30. The 320 is the width in pixels of our requested screen, if we changed this to
  31. say 160, only half of our T.V screen would be used by our program (left half)
  32. There is no real limit to the width of our screen, but for now we are best 
  33. off to stick to a maximum of 320 in lowres and 640 in hires.
  34.  
  35. The 16 is the number of colours we wish to be available to us, remember the
  36. more colours you employ the more memory you use and a possibility of slowing
  37. some programs down.  As a rule most people tend to use 4,8,16 or 32 colours
  38. for their screens.  There are some limits to the amount of colours you can
  39. use in hires but I would advise a maximum of eight.
  40.  
  41. LOWRES: There are only two options here LOWRES and HIRES. Rather than explain
  42. the difference again take a look at EXAMPLE13.Amos and you will understand.
  43.  
  44. That is Amos`s default screen that we use. Here are the custom screens used
  45. in EXAMPLE13.Amos
  46.  
  47. SCREEN OPEN 0,250,80,4,lowres
  48. -----------------------------
  49. Screen I.D = 0
  50. Width      = 250 pixels across 
  51. height     = 80 pixels top to bottom
  52. Colours    = 4, using 0 to 3
  53. Mode       = Lowres 
  54.  
  55. SCREEN OPEN 0,640,256,8,hires
  56. -----------------------------
  57. Screen I.D = 0
  58. Width      = 640 pixels across 
  59. height     = 256 pixels top to bottom
  60. Colours    = 8, using 0 to 7
  61. Mode       = Hires (80 column text, 0-79)
  62.  
  63. Make notes of the five attributes of SCREEN OPEN for future reference and you
  64. won`t go far wrong.  Experiment with EXAMPLE13.Amos and see what weird and
  65. wonderful screens you can come up with.
  66.  
  67. SCREEN DISPLAY
  68. ==============
  69. Take a look at EXAMPLE13_1.Amos for a demonstration of how SCREEN DISPLAY 
  70. works. 
  71.  
  72. This command allows us to position a previously defined screen to anywhere on
  73. the TV display.  This is the syntax of the command.
  74.  
  75. SCREEN DISPLAY N,X,Y,W,H
  76. --------------------------
  77. don`t be put off yet because it looks odd, I will break this down for you.
  78.  
  79.  N
  80. ---
  81. is the number of the screen you wish to position.  Say for example we had
  82. two screens open, 0 and 1, and we want to position screen 1 then we would put
  83. a 1 here.
  84.  
  85.  X
  86. ---
  87. X is the position across your TV screen, but this time just to confuse us the
  88. positioning isn`t in pixels or characters but in hardware coordinates.
  89. For the moment don`t worry about why just remember that your X must be in the
  90. range 112 to 448, 112 being the left edge of the screen.
  91.  
  92.  Y
  93. ---
  94. Y is also in hardware coordinates.  This tells SCREEN DISPLAY how far
  95. down the display we want to position our new screen.  The limits here are
  96. 0 to 312, with 0 being the top of the T.V screen.
  97.  
  98. W,H
  99. ---
  100. Width, Height, we can leave these out luckily because SCREEN DISPLAY will
  101. use the Width and Height of our previously opened custom screen so all we
  102. need in W and H's place are two commas like this ,,
  103.  
  104. In EXAMPLE13_1 another new command appears, this the SCREEN command and 
  105. instructs Amos as to which screen we want to use if we have more than one 
  106. screen open. For example if we did:
  107.  
  108. SCREEN OPEN 0,228,80,4,lowres
  109. SCREEN OPEN 1,150,100,8,lowres
  110.  
  111. Amos would now use screen one as the current screen so if for example we
  112. did PRINT "HELLO" the words HELLO would appear in screen 1.
  113.  
  114. This is where the SCREEN command comes in. What if we wanted the words HELLO
  115. printed on screen 0?  We just issue the command:
  116.  
  117. SCREEN 0
  118.  
  119. And Amos will now use SCREEN 0 as the current screen.
  120.  
  121. The SCREEN OFFSET instruction has many uses and lots of different and 
  122. startling effects can be achieved with it. But this is as far as we will go
  123. for now with screen commands as we have begun to stretch the limits of a 
  124. beginners course in Amos.
  125.  
  126. Here are a few more SCREEN related commands that are easy to use that you
  127. may want to investigate further.
  128.  
  129. SCREEN HIDE     : Literally HIDE a screen from the users view.
  130. SCREEN SHOW     : Bring the hidden screen back
  131. H=SCREEN HEIGHT : H returns the height of the current screen
  132. W=SCREEN WIDTH  : W returns width
  133. C=SCREEN COLOUR : C returns amount of colours used by current screen
  134. SCREEN CLOSE N  : Deletes SCREEN number N and frees up the memory it used
  135.  
  136.                            End of chapter thirteen
  137.                            ^^^^^^^^^^^^^^^^^^^^^^^
  138.